// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.keymap;

import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;
import java.util.Set;

public abstract class KeymapsTestCase extends KeymapsTestCaseBase {
  /**
   * This table lists known actions which use the same shortcut. Note that it's ok to add a new entry here only if you're sure that the
   * mentioned actions will never be enabled in the same context. Otherwise, users may get unexpected behavior when they try to use that
   * shortcut.
   */
  private static final Map<String, String[][]> DEFAULT_DUPLICATES = Map.ofEntries(
    Map.entry("$default", new String[][]{
      {"ADD",                      "ExpandTreeNode", "Graph.ZoomIn"},
      {"BACK_SPACE",               "EditorBackSpace", "FileChooser.GoToParent"},
      {"C",                        "Uml.CollapseNodes", "JupyterNotebookCopyCellCommandModeAction"},
      {"DELETE",                   "$Delete", "DatabaseView.DropAction", "JupyterNotebookDeleteCellCommandModeAction"},
      {"DOWN",                     "EditorDown", "Terminal.SelectBlockBelow"},
      {"ENTER",                    "Console.Execute", "Console.TableResult.EditValue", "DirDiffMenu.SynchronizeDiff", "EditorChooseLookupItem",
                                   "EditorEnter", "NextTemplateVariable", "Git.Log.Branches.Change.Branch.Filter", "SplitChooser.Split",
                                   "JupyterMarkdownDestroyControllerAction", "Console.TableResult.GotoReferencedResult"},
      {"ESCAPE",                   "CloseGotItTooltip", "EditorEscape", "FocusEditor", "Terminal.SwitchFocusToEditor", "CloseDiffEditor"},
      {"F1",                       "ContextHelp", "org.jetbrains.r.actions.REditorHelpAction"},
      {"F2",                       "GotoNextError", "GuiDesigner.EditComponent", "GuiDesigner.EditGroup", "Console.TableResult.EditValue",
                                   "XDebugger.SetValue", "Git.Reword.Commit", "Git.Rename.Local.Branch", "ShelvedChanges.Rename", "ChangesView.Rename",
                                   "Table-startEditing", "Tree-startEditing", "Console.TableResult.GotoReferencedResult"},
      {"F5",                       "Graph.RouteEdges", "CopyElement", "WebInspector.Browser.Refresh"},
      {"F7",                       "NextDiff", "StepInto"},
      {"F12",                      "JumpToLastWindow","WebInspector.Browser.Selection.Toggle"},
      {"INSERT",                   "EditorToggleInsertState", "UsageView.Include", "DomCollectionControl.Add",
                                   "XDebugger.NewWatch"},
      {"RIGHT",                    "EditorRight", "Terminal.InsertInlineCompletionItem"},
      {"SPACE",                    "Console.TableResult.ColumnVisibility", "QuickPreview", "SplitChooser.SplitCenter", "CollapsiblePanel-toggle"},
      {"SUBTRACT",                 "CollapseTreeNode", "Graph.ZoomOut"},
      {"TAB",                      "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection",
                                   "EditorTab", "ExpandLiveTemplateByTab", "BraceOrQuoteOut", "SplitChooser.NextWindow", "InsertInlineCompletionAction",
                                   "Terminal.CommandCompletion", "CodeFloatingToolbar.GotoNextMenu", "AIAssistant.Editor.AcceptOneLineCompletion", 
                                   "InlinePromptGenerateCodeAction", "InsertNextEditAction"},
      {"UP",                       "EditorUp", "Terminal.SelectBlockAbove"},
      {"alt DOWN",                 "MethodDown", "ShowContent", "ShowSearchHistory", "JupyterNotebookMoveCellDownCommandModeAction", "NotebookMoveCellDownAction"},
      {"alt ENTER",                "ShowIntentionActions", "Console.TableResult.EditValue", "JupyterNotebookRunCellInsertBelowCommandModeAction",
                                   "Console.TableResult.GotoReferencedResult"},
      {"alt F6",                   "CommanderSyncViews", "EditPropertyValue"},
      {"alt INSERT",               "FileChooser.NewFolder", "Generate", "NewElement"},
      {"alt J",                    "SelectNextOccurrence", "JupyterNotebookMoveCellDownCommandModeAction"},
      {"alt UP",                   "MethodUp", "JupyterNotebookMoveCellUpCommandModeAction", "NotebookMoveCellUpAction"},
      {"alt button1",              "EditorCreateRectangularSelectionOnMouseDrag", "QuickEvaluateExpression"},
      {"alt shift LEFT",           "Diff.PrevChange", "PreviousEditorTab"},
      {"alt shift RIGHT",          "Diff.NextChange", "NextEditorTab"},
      {"button1 doubleClick",      "Git.Log.Branches.Change.Branch.Filter", "Console.TableResult.GotoReferencedResult"},
      {"button2",                  "EditorPasteFromX11", "GotoDeclaration", "EditorCreateRectangularSelectionOnMouseDrag"},
      {"control 1",                "FileChooser.GotoHome", "GotoBookmark1", "DuplicatesForm.SendToLeft"},
      {"control 2",                "FileChooser.GotoProject", "GotoBookmark2", "DuplicatesForm.SendToRight"},
      {"control 3",                "GotoBookmark3", "FileChooser.GotoModule"},
      {"control ADD",              "ExpandAll", "ExpandExpandableComponent", "ExpandRegion"},
      {"control A",                "$SelectAll", "Terminal.MoveCaretToLineStart"},
      {"control B",                "GotoDeclaration", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"control C",                "$Copy", "Terminal.ClearPrompt", "Terminal.CopySelectedText", "org.jetbrains.r.console.RConsoleView.RInterruptAction",
                                   "JupyterNotebookCopyCellCommandModeAction"},
      {"control D",                "EditorDuplicate", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "Terminal.CloseSession",
                                   "FileChooser.GotoDesktop", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"control DIVIDE",           "CommentByLineComment", "Graph.ActualSize"},
      {"control DOWN",             "EditorScrollDown", "EditorLookupDown", "MethodOverloadSwitchDown", "NotebookSelectCellBelowAction",
                                   "Terminal.SelectPrompt"},
      {"control E",                "RecentFiles", "SwitcherIterateItems", "SwitcherRecentEditedChangedToggleCheckBox", "Terminal.MoveCaretToLineEnd"},
      {"control ENTER",            "Console.Execute.Multiline", "DirDiffMenu.SynchronizeDiff.All", "EditorSplitLine", "NotebookRunCellAction",
                                   "PyExecuteCellAction", "SplitChooser.Duplicate", "Terminal.SmartCommandExecution.Run", "ViewSource",
                                   "org.jetbrains.r.actions.RunSelection", "Docker.RemoteServers.StartComposeService", "GraphQLExecuteEditor"},
      {"control EQUALS",           "ExpandAll", "ExpandExpandableComponent", "ExpandRegion"},
      {"control F5",               "Refresh", "Rerun"},
      {"control I",                "ImplementMethods", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"control INSERT",           "$Copy", "Terminal.CopySelectedText"},
      {"control M",                "EditorScrollToCenter", "Vcs.ShowMessageHistory"},
      {"control MINUS",            "CollapseAll", "CollapseExpandableComponent", "CollapseRegion"},
      {"control N",                "FileChooser.NewFolder", "GotoClass"},
      {"control P",                "FileChooser.TogglePathBar", "ParameterInfo"},
      {"control PERIOD",           "EditorChooseLookupItemDot", "CollapseSelection"},
      {"control R",                "Replace", "Terminal.SearchInCommandHistory", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"control SLASH",            "CommentByLineComment", "Graph.ActualSize"},
      {"control SPACE",            "CodeCompletion", "ChangesView.SetDefault"},
      {"control SUBTRACT",         "CollapseAll", "CollapseExpandableComponent", "CollapseRegion"},
      {"control U",                "GotoSuperMethod", "CommanderSwapPanels", "org.intellij.plugins.markdown.ui.actions.styling.InsertImageAction"},
      {"control UP",               "EditorScrollUp", "EditorLookupUp", "MethodOverloadSwitchUp", "NotebookSelectCellAboveAction",
                                   "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"control V",                "$Paste", "Terminal.Paste", "JupyterNotebookPasteCellCommandModeAction"},
      {"control W",                "EditorSelectWord", "Terminal.DeletePreviousWord"},
      {"control X",                "$Cut", "JupyterNotebookCutCellCommandModeAction"},
      {"control alt A",            "ChangesView.AddUnversioned", "Diagram.DeselectAll", "Diff.ApplyRightSide"},
      {"control alt B",            "GotoImplementation", "org.jetbrains.r.rendering.chunk.RunChunksAboveAction"},
      {"control alt D",            "Console.TableResult.SetDefault", "org.jetbrains.r.actions.RMarkdownInterruptAction"},
      {"control alt DOWN",         "NextOccurence", "Console.TableResult.NextPage"},
      {"control alt E",            "Console.History.Browse", "PerforceDirect.Edit", "ToggleFindInSelection"},
      {"control alt G",            "DatabaseView.SqlGenerator", "org.jetbrains.plugins.ruby.rails.actions.generators.GeneratorsPopupAction",
                                   "Mvc.RunTarget", "GoGenerateFileAction"},
      {"control alt I",            "AutoIndentLines", "RMarkdownNewChunk"},
      {"control alt K",            "Git.Commit.And.Push.Executor", "Hg.Commit.And.Push.Executor"},
      {"control alt N",            "Inline", "Console.TableResult.SetNull"},
      {"control alt R",            "Diff.ApplyLeftSide", "org.jetbrains.plugins.ruby.tasks.rake.actions.RakeTasksPopupAction", "Django.RunManageTaskAction"},
      {"control alt UP",           "PreviousOccurence", "Console.TableResult.PreviousPage"},
      {"control alt X",            SECOND_STROKE, "org.jetbrains.r.rendering.chunk.DebugChunkAction"},
      {"control alt Z",            "Vcs.RollbackChangedLines", "ChangesView.Revert"},
      {"control alt button1",      "GotoImplementation", "UiInspector"},
      {"ctrl L",                   "FindNext", "Terminal.ClearBuffer"},
      {"ctrl alt C",               "IntroduceConstant", "org.jetbrains.r.rendering.chunk.RunChunkAction"},
      {"ctrl alt ENTER",           "EditorStartNewLineBefore", "QuickActionPopup", "org.jetbrains.r.actions.DebugSelection"},
      {"ctrl alt F",               "IntroduceField", "ShowFilterPopup"},
      {"ctrl alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "Forward"},
      {"ctrl alt U",               "ShowUmlDiagramPopup", "ChangesView.UnshelveSilently"},
      {"shift DELETE",             "$Cut", "Maven.Uml.Exclude"},
      {"shift ENTER",              "CollapseExpandableComponent", "Console.TableResult.EditValueMaximized", "DatabaseView.PropertiesAction",
                                   "EditorStartNewLine", "ExpandExpandableComponent", "NotebookRunCellSelectBelowAction", "OpenInRightSplit",
                                   "PyExecuteCellActionWithMove", "RConsoleNextLineAction"},
      {"shift F4",                 "XDebugger.JumpToTypeSource", "EditSourceInNewWindow"},
      {"shift F6",                 "RenameElement", "Git.Reword.Commit", "Git.Rename.Local.Branch", "ShelvedChanges.Rename", "ChangesView.Rename"},
      {"shift F7",                 "PreviousDiff", "SmartStepInto"},
      {"shift DOWN",               "EditorDownWithSelection", "JupyterExpandSelectionToCellBelowCommandModeAction"},
      {"shift INSERT",             "$Paste", "Terminal.Paste"},
      {"shift LEFT",               "EditorLeftWithSelection", "JupyterExpandSelectionToCellAboveCommandModeAction"},
      {"shift M",                  "Graph.AlignNodes.Middle", "JupyterNotebookMergeSelectedCellsCommandModeAction"},
      {"shift RIGHT",              "EditorRightWithSelection", "JupyterExpandSelectionToCellBelowCommandModeAction"},
      {"shift TAB",                "PreviousTemplateVariable", "PrevParameter", "EditorUnindentSelection", "SplitChooser.PreviousWindow",
                                   "CodeFloatingToolbar.GotoPrevMenu"},
      {"shift UP",                 "EditorUpWithSelection", "JupyterExpandSelectionToCellAboveCommandModeAction"},
      {"shift V",                  "Graph.DistributeNodes.Vertically", "JupyterNotebookPasteCellAboveCommandModeAction"},
      {"shift alt A",              "NotebookInsertCellAboveAction", "VcsHistory.ShowAllAffected"},
      {"shift alt B",              "NotebookInsertCellBelowAction", "tasks.open.in.browser", "sql.SelectInDatabaseView"},
      {"shift alt ENTER",          "AIAssistant.Editor.AcceptMultiLineCompletion", "Console.TableResult.EditValueMaximized", "JupyterDebugAction", "SplitChooser"},
      {"shift alt F7",             "ForceStepInto", "StepIntoMyCode"},
      {"shift alt G",              "EditorAddCaretPerSelectedLine", "hg4idea.QGotoFromPatches"},
      {"shift alt M",              "ChangesView.Move", "Vcs.MoveChangedLinesToChangelist"},
      {"shift control D",          "Diff.ShowSettingsPopup", "Uml.ShowDiff", "Console.TableResult.CompareCells", "JavaScript.ShowComponentUsages"},
      {"shift control ENTER",      "EditorCompleteStatement", "Console.Jpa.GenerateSql", "org.jetbrains.r.actions.RRunAction",
                                   "Terminal.SmartCommandExecution.Debug", "Console.TableResult.ShowRecordView"},
      {"shift control F10",        "Console.Open", "RunClass", "RunTargetAction"},
      {"shift control F8",         "ViewBreakpoints", "EditBreakpoint"},
      {"shift control H",          "ChangesView.ShelveSilently", "MethodHierarchy"},
      {"shift control M",          "EditorMatchBrace", "RInsertPipeAction"},
      {"shift control MINUS",      "CollapseAllRegions", "NotebookSplitCellAction"},
      {"shift control T",          "GotoTest", "ServiceView.ShowServices", "Terminal.NewTab"},
      {"shift control TAB",        "Switcher", "Diff.FocusOppositePane"},
      {"shift control U",          "ShelveChanges.UnshelveWithDialog", "EditorToggleCase", "Markdown.Styling.CreateLink"},
      {"shift control V",          "PasteMultiple", "JupyterNotebookPasteCellAboveCommandModeAction"},
      {"shift control alt D",      "UML.ShowChanges", "Console.TableResult.CloneColumn"},
      {"shift control alt ENTER",  "Console.Jpa.GenerateDDL", "Console.TableResult.SubmitAndCommit", "Console.Transaction.Commit",
                                   "NotebookRunAllAction", "org.jetbrains.r.actions.RDebugAction"},
      {"shift control alt P",      "IntroduceFunctionalParameter", "ReformatWithPrettierAction", "GoFmtProjectAction"},
      {"shift ctrl C",             "CopyPaths", "DatabaseView.CopyDdlAction", "org.intellij.plugins.markdown.ui.actions.styling.ToggleCodeSpanAction"},
      {"shift ctrl X",             "Code.Review.Editor.New.Comment", "com.jetbrains.php.framework.FrameworkRunConsoleAction"},
      {"shift ctrl alt C",         "CopyReference", "Gauge.Extract"},
      {"shift ctrl alt DOWN",      "ResizeToolWindowDown", "VcsShowNextChangeMarker"},
      {"shift ctrl alt F",         "DatabaseView.FullTextSearch", "Console.TableResult.EditFilterCriteria", "GoFmtFileAction", "TFFmtFileAction"},
      {"shift ctrl alt L",         "ShowReformatFileDialog", "Gauge.Format"},
      {"shift ctrl alt LEFT",      "MoveElementLeft", "ResizeToolWindowLeft"},
      {"shift ctrl alt S",         "ShowProjectStructureSettings", "GoShareInPlaygroundAction"},
      {"shift ctrl alt RIGHT",     "MoveElementRight", "ResizeToolWindowRight"},
      {"shift ctrl alt UP",        "ResizeToolWindowUp", "VcsShowPrevChangeMarker"},
      {"shift ctrl alt M",         "Console.TableResult.MaximizeEditingCell", "FullLine.GenerateMarkerAction"},
      {"ctrl alt N",               "Console.TableResult.SetNull", "Git.New.Branch.In.Log", "GitNewBranchAction", "Inline"},
      {"ctrl BACK_SLASH",          "AIAssistant.Editor.AskAiAssistantInEditor", "FileChooser.GoToRoot"},
      {"alt BACK_SLASH",           "CallInlineCompletionAction", "MainMenuButton.ShowMenu"},
      {"shift ctrl EQUALS",        "CompilationChartsZoomResetAction", "ExpandAllRegions"},
    }),
    Map.entry("Mac OS X 10.5+", new String[][]{
      {"BACK_SPACE",               "$Delete", "EditorBackSpace"},
      {"F1",                       "QuickJavaDoc", "org.jetbrains.r.actions.REditorHelpAction"},
      {"Force touch",              "GotoDeclaration", "RunToCursor"},
      {"alt DOWN",                 "EditorUnSelectWord", "MethodOverloadSwitchDown", "ShowSearchHistory", "JupyterNotebookMoveCellDownCommandModeAction", "NotebookMoveCellDownAction"},
      {"alt R",                    "Django.RunManageTaskAction", "org.jetbrains.plugins.ruby.tasks.rake.actions.RakeTasksPopupAction"},
      {"alt UP",                   "EditorSelectWord", "MethodOverloadSwitchUp", "JupyterNotebookMoveCellUpCommandModeAction", "NotebookMoveCellUpAction"},
      {"control A",                "EditorLineStart", "Terminal.MoveCaretToLineStart"},
      {"control C",                "Terminal.ClearPrompt", "org.jetbrains.r.console.RConsoleView.RInterruptAction"},
      {"control D",                "Debug", "Terminal.CloseSession", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"control E",                "EditorLineEnd", "Terminal.MoveCaretToLineEnd"},
      {"control ENTER",            "Generate", "NotebookRunCellAction", "NewElement", "PyExecuteCellAction"},
      {"control M",                "EditorMatchBrace", "Vcs.ShowMessageHistory"},
      {"control O",                "ExportToTextFile", "OverrideMethods"},
      {"control R",                "Run", "Terminal.SearchInCommandHistory"},
      {"control SPACE",            "CodeCompletion", "ChangesView.SetDefault"},
      {"control shift LEFT",       "Diff.PrevChange", "PreviousEditorTab"},
      {"control shift RIGHT",      "Diff.NextChange", "NextEditorTab"},
      {"ctrl alt DOWN",            "GotoNextElementUnderCaretUsage", "ResizeToolWindowDown"},
      {"ctrl alt F",               "EditorNextWord", "ShowFilterPopup"},
      {"ctrl alt LEFT",            "EmmetPreviousEditPoint", "ResizeToolWindowLeft"},
      {"ctrl alt RIGHT",           "EmmetNextEditPoint", "ResizeToolWindowRight"},
      {"ctrl alt UP",              "GotoPrevElementUnderCaretUsage", "ResizeToolWindowUp"},
      {"ctrl meta RIGHT",          "AIAssistant.Editor.AcceptOneLineCompletion", "Diff.ApplyLeftSide"},
      {"meta 1",                   "ActivateProjectToolWindow", "FileChooser.GotoHome", "DuplicatesForm.SendToLeft"},
      {"meta 2",                   "ActivateBookmarksToolWindow", "FileChooser.GotoProject", "DuplicatesForm.SendToRight"},
      {"meta 3",                   "ActivateFindToolWindow", "FileChooser.GotoModule"},
      {"meta A",                   "$SelectAll", "Terminal.SelectAll"},
      {"meta BACK_SPACE",          "EditorDeleteLine", "$Delete"},
      {"meta C",                   "$Copy", "JupyterNotebookCopyCellCommandModeAction", "Terminal.CopyBlock", "Terminal.CopySelectedText"},
      {"meta DOWN",                "EditSource", "Terminal.SelectPrompt"},
      {"meta I",                   "DatabaseView.PropertiesAction", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"meta K",                   "CheckinProject", "Terminal.ClearBuffer"},
      {"meta L",                   "GotoLine", "Terminal.ClearBuffer"},
      {"meta N",                   "FileChooser.NewFolder", "Generate", "NewElement"},
      {"meta R",                   "Refresh", "Replace", "Rerun", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"meta T",                   "Terminal.NewTab", "Vcs.UpdateProject"},
      {"meta SLASH",               "CommentByLineComment", "FileChooser.GoToRoot", "Graph.ActualSize"},
      {"meta UP",                  "ShowNavBar", "FileChooser.GoToParent", "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"shift BACK_SPACE",         "EditorBackSpace", "UsageView.Include"},
      {"shift control TAB",        "Switcher", "Diff.FocusOppositePane"},
      {"shift ctrl DOWN",          "MethodDown", "ShowContent"},
      {"shift meta C",             "CopyPaths", "DatabaseView.CopyDdlAction", "WebInspector.Browser.Selection.Toggle", "org.intellij.plugins.markdown.ui.actions.styling.ToggleCodeSpanAction"},
      {"shift meta L",             "Jdbc.OpenConsole.New", "rspec.LetIntroduce"},
      {"shift meta M",             "ChangesView.Move", "RInsertPipeAction", "Vcs.MoveChangedLinesToChangelist"},
      {"shift meta R",             "WebInspector.Browser.Refresh", "ReplaceInPath"},
    }),
    Map.entry("Mac OS X", new String[][]{
      {"BACK_SPACE",               "$Delete", "EditorBackSpace"},
      {"Force touch",              "GotoDeclaration", "RunToCursor"},
      {"alt R",                    "Django.RunManageTaskAction", "org.jetbrains.plugins.ruby.tasks.rake.actions.RakeTasksPopupAction"},
      {"control C",                "Terminal.ClearPrompt", "org.jetbrains.r.console.RConsoleView.RInterruptAction"},
      {"control D",                "Terminal.CloseSession", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"control DOWN",             "EditorLookupDown", "NotebookSelectCellBelowAction", "MethodDown"},
      {"control ENTER",            "Generate", "NotebookRunCellAction", "NewElement", "PyExecuteCellAction"},
      {"control F5",               "Refresh", "Rerun"},
      {"control N",                "Generate", "NewElement"},
      {"control UP",               "EditorLookupUp", "NotebookSelectCellAboveAction", "MethodUp"},
      {"control shift LEFT",       "Diff.PrevChange", "PreviousEditorTab"},
      {"control shift RIGHT",      "Diff.NextChange", "NextEditorTab"},
      {"ctrl SPACE",               "ChangesView.SetDefault", "CodeCompletion"},
      {"ctrl meta RIGHT",          "AIAssistant.Editor.AcceptOneLineCompletion", "Diff.ApplyLeftSide"},
      {"meta 1",                   "ActivateProjectToolWindow", "FileChooser.GotoHome", "DuplicatesForm.SendToLeft"},
      {"meta 2",                   "ActivateBookmarksToolWindow", "FileChooser.GotoProject", "DuplicatesForm.SendToRight"},
      {"meta 3",                   "ActivateFindToolWindow", "FileChooser.GotoModule"},
      {"meta A",                   "$SelectAll", "Terminal.SelectAll"},
      {"meta C",                   "$Copy", "JupyterNotebookCopyCellCommandModeAction", "Terminal.CopyBlock", "Terminal.CopySelectedText"},
      {"meta K",                   "CheckinProject", "Terminal.ClearBuffer"},
      {"meta R",                   "WebInspector.Browser.Refresh", "Replace", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"meta SLASH",               "CommentByLineComment", "FileChooser.GoToRoot", "Graph.ActualSize"},
      {"meta T",                   "Terminal.NewTab", "Vcs.UpdateProject"},
      {"meta UP",                  "EditorScrollUp", "FileChooser.GoToParent", "MethodOverloadSwitchUp", "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"shift control TAB",        "Switcher", "Diff.FocusOppositePane"},
      {"shift meta C",             "CopyPaths", "DatabaseView.CopyDdlAction", "WebInspector.Browser.Selection.Toggle", "org.intellij.plugins.markdown.ui.actions.styling.ToggleCodeSpanAction"},
    }),
    Map.entry("Emacs", new String[][]{
      {"ESCAPE",                   SECOND_STROKE, "CloseGotItTooltip", "FocusEditor", "Terminal.SwitchFocusToEditor", "CloseDiffEditor"},
      {"TAB",                      "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection",
                                   "EmacsStyleIndent", "ExpandLiveTemplateByTab", "BraceOrQuoteOut", "SplitChooser.NextWindow", "InsertInlineCompletionAction",
                                   "Terminal.CommandCompletion", "CodeFloatingToolbar.GotoNextMenu", "AIAssistant.Editor.AcceptOneLineCompletion",
                                   "InlinePromptGenerateCodeAction", "InsertNextEditAction"},
      {"alt MINUS",                SECOND_STROKE, "RInsertAssignmentAction"},
      {"alt SLASH",                "CodeCompletion", "HippieCompletion"},
      {"control A",                "EditorLineStart", "Terminal.MoveCaretToLineStart"},
      {"control B",                "EditorLeft", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"control D",                "$Delete", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "Terminal.CloseSession",
                                   "FileChooser.GotoDesktop", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"control E",                "EditorLineEnd", "Terminal.MoveCaretToLineEnd"},
      {"control DOWN",             "EditorForwardParagraph", "EditorLookupDown", "NotebookSelectCellBelowAction", "MethodOverloadSwitchDown",
                                   "Terminal.SelectPrompt"},
      {"control K",                "EditorCutLineEnd", "CheckinProject"},
      {"control M",                "EditorEnter", "EditorChooseLookupItem", "NextTemplateVariable", "Console.Execute"},
      {"control N",                "EditorDown", "FileChooser.NewFolder"},
      {"control P",                "EditorUp", "FileChooser.TogglePathBar"},
      {"control R",                "FindPrevious", "Terminal.SearchInCommandHistory", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"control SLASH",            "$Undo", "Graph.ActualSize"},
      {"control SPACE",            "EditorToggleStickySelection", "ChangesView.SetDefault"},
      {"control UP",               "EditorBackwardParagraph", "EditorLookupUp", "NotebookSelectCellAboveAction", "MethodOverloadSwitchUp",
                                   "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"control W",                "EditorKillRegion", "Terminal.DeletePreviousWord"},
      {"control alt A",            "MethodUp", "ChangesView.AddUnversioned", "Diagram.DeselectAll"},
      {"control alt E",            "Console.History.Browse", "MethodDown", "PerforceDirect.Edit", "ToggleFindInSelection"},
      {"control alt G",            "GotoDeclaration", "org.jetbrains.plugins.ruby.rails.actions.generators.GeneratorsPopupAction", "Mvc.RunTarget"},
      {"control alt S",            "ShowSettings", "Find"},
      {"ctrl L",                   "EditorScrollToCenter", "Terminal.ClearBuffer"},
      {"ctrl V",                   "EditorPageDown", "Terminal.Paste", "JupyterNotebookPasteCellCommandModeAction"},
      {"ctrl X",                   SECOND_STROKE, "JupyterNotebookCutCellCommandModeAction"},
      {"shift alt G",              "GotoClass", "hg4idea.QGotoFromPatches"},
      {"shift alt P",              "ParameterInfo", "hg4idea.QPushAction"},
      {"shift alt S",              "FindUsages", "context.save"},
      {"shift control X",          SECOND_STROKE, "com.jetbrains.php.framework.FrameworkRunConsoleAction"},
      {"shift ctrl MINUS",         "$Undo", "NotebookSplitCellAction"},
    }),
    Map.entry("Visual Studio", new String[][]{
      {"alt BACK_SLASH",           "CallInlineCompletionAction", "FileStructurePopup"},
      {"F5",                       "Graph.RouteEdges", "Resume", "WebInspector.Browser.Refresh"},
      {"F7",                       "CompileDirty", "NextDiff"},
      {"F12",                      "GotoDeclaration", "WebInspector.Browser.Selection.Toggle"},
      {"alt O",                    "SwitchHeaderSource", "ExportToTextFile"},
      {"control alt button1",      "EditorAddOrRemoveCaret", "UiInspector"},
      {"ctrl E",                   SECOND_STROKE, "SwitcherIterateItems", "SwitcherRecentEditedChangedToggleCheckBox", "Terminal.MoveCaretToLineEnd"},
      {"ctrl ENTER",               "Console.Execute.Multiline", "DirDiffMenu.SynchronizeDiff.All", "EditorStartNewLineBefore",
                                   "NotebookRunCellAction", "PyExecuteCellAction", "ViewSource", "org.jetbrains.r.actions.RunSelection",
                                   "Terminal.SmartCommandExecution.Run", "SplitChooser.Duplicate", "Docker.RemoteServers.StartComposeService",
                                   "GraphQLExecuteEditor"},
      {"ctrl F10",                 "RunToCursor", "UpdateRunningApplication"},
      {"ctrl H",                   "Replace", "Vcs.ShowMessageHistory"},
      {"ctrl I",                   "IncrementalSearch", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"ctrl L",                   "EditorDeleteLine", "Terminal.ClearBuffer"},
      {"ctrl MINUS",               "Back", "CollapseAll", "CollapseExpandableComponent"},
      {"ctrl N",                   "FileChooser.NewFolder", "NewElement"},
      {"ctrl P",                   "FileChooser.TogglePathBar", "Print"},
      {"ctrl PERIOD",              "EditorChooseLookupItemDot", "ShowIntentionActions"},
      {"ctrl R",                   SECOND_STROKE, "Terminal.SearchInCommandHistory", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"ctrl R,R",                 "ChangesView.Rename", "Git.Rename.Local.Branch", "Git.Reword.Commit", "RenameElement", "ShelvedChanges.Rename"},
      {"ctrl SUBTRACT",            "Back", "CollapseAll", "CollapseExpandableComponent"},
      {"ctrl alt B",               "ViewBreakpoints", "org.jetbrains.r.rendering.chunk.RunChunksAboveAction"},
      {"ctrl alt ENTER",           "ReformatCode", "org.jetbrains.r.actions.DebugSelection"},
      {"ctrl alt F",               "ActivateStructureToolWindow", "ShowFilterPopup"},
      {"ctrl alt R",               "Diff.ApplyLeftSide", "Refresh"},
      {"ctrl alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "EditorSelectWord"},
      {"ctrl alt W",               "ActivateWebToolWindow", "Vcs.UpdateProject"},
      {"shift F5",                 "Graph.ApplyCurrentLayout", "Stop"},
      {"shift alt ENTER",          "AIAssistant.Editor.AcceptMultiLineCompletion", "JupyterDebugAction", "ToggleFullScreen"},
      {"shift alt F11",            "FindUsagesInFile", "HighlightUsagesInFile"},
      {"shift alt LEFT",           "Diff.PrevChange", "EditorLeftWithSelection"},
      {"shift alt OPEN_BRACKET",   "EditorCodeBlockStart", "EmmetPreviousEditPoint"},
      {"shift alt RIGHT",          "Diff.NextChange", "EditorRightWithSelection"},
      {"shift alt button1",        "EditorCreateRectangularSelection", "EditorCreateRectangularSelectionOnMouseDrag"},
      {"shift ctrl H",             "ChangesView.ShelveSilently", "ReplaceInPath"},
      {"shift ctrl MINUS",         "Forward", "NotebookSplitCellAction"},
      {"shift ctrl S",             "SaveAll", "org.intellij.plugins.markdown.ui.actions.styling.ToggleStrikethroughAction"},
      {"shift ctrl T",             "GotoFile", "Terminal.NewTab"},
      {"shift ctrl alt DOWN",      "MoveStatementDown", "ResizeToolWindowDown"},
      {"shift ctrl alt K",         "Git.Commit.And.Push.Executor", "Hg.Commit.And.Push.Executor"},
      {"shift ctrl alt P",         "IntroduceFunctionalParameter", "ReformatWithPrettierAction", "VcsShowPrevChangeMarker"},
      {"shift ctrl alt UP",        "MoveStatementUp", "ResizeToolWindowUp"},
      {"ctrl SLASH",               "AIAssistant.Editor.AskAiAssistantInEditor", "Graph.ActualSize"},
      {"alt SLASH",                "CallInlineCompletionAction", "HippieCompletion"},
      {"F8",                       "NextOccurence", "NextDiff"},
      {"shift F8",                 "PreviousOccurence", "PreviousDiff"},
    }),
    Map.entry("Visual Studio OSX", new String[][]{
      {"F12",                      "GotoDeclaration", "WebInspector.Browser.Selection.Toggle"},
      {"meta L",                   "$Cut", "Terminal.ClearBuffer"},
      {"alt BACK_SLASH",           "CallInlineCompletionAction", "FileStructurePopup"},
      {"alt DELETE",               "EditorDeleteToWordEnd", "SafeDelete"},
      {"shift ctrl RIGHT",         "Diff.NextChange", "EditorRightWithSelection"},
      {"meta F10",                 "RunToCursor", "UpdateRunningApplication"},
      {"ctrl alt LEFT",            "GotoSuperMethod", "ResizeToolWindowLeft"},
      {"meta Y",                   "$Redo", "QuickImplementations"},
      {"meta alt B",               "ViewBreakpoints", "org.jetbrains.r.rendering.chunk.RunChunksAboveAction"},
      {"meta SUBTRACT",            "Back", "CollapseAll", "CollapseExpandableComponent"},
      {"meta MINUS",               "Back", "CollapseAll", "CollapseExpandableComponent"},
      {"shift F5",                 "Graph.ApplyCurrentLayout", "Stop"},
      {"shift meta alt R",         "ChooseRunConfiguration", "ForceRefresh"},
      {"ctrl alt F",               "ActivateStructureToolWindow", "EditorNextWord", "ShowFilterPopup"},
      {"meta alt ENTER",           "QuickActionPopup", "ReformatCode", "org.jetbrains.r.actions.DebugSelection"},
      {"meta alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "EditorSelectWord"},
      {"shift meta L",             "EditorDeleteLine", "Jdbc.OpenConsole.New", "rspec.LetIntroduce"},
      {"shift alt ENTER",          "AIAssistant.Editor.AcceptMultiLineCompletion", "JupyterDebugAction", "ToggleFullScreen"},
      {"shift alt F11",            "FindUsagesInFile", "HighlightUsagesInFile"},
      {"shift meta alt P",         "GoFmtProjectAction", "IntroduceFunctionalParameter", "ReformatWithPrettierAction", "VcsShowPrevChangeMarker"},
      {"alt F11",                  "ForceStepInto", "RunJsbtTask"},
      {"meta I",                   "DatabaseView.PropertiesAction", "IncrementalSearch", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"F5",                       "Graph.RouteEdges", "WebInspector.Browser.Refresh", "Resume"},
      {"shift meta MINUS",         "Forward", "NotebookSplitCellAction"},
      {"F7",                       "CompileDirty", "NextDiff"},
      {"meta ENTER",               "Console.Execute.Multiline", "DirDiffMenu.SynchronizeDiff.All", "Docker.RemoteServers.StartComposeService", "EditorStartNewLineBefore", "SplitChooser.Duplicate", "Terminal.SmartCommandExecution.Run", "ViewSource", "org.jetbrains.r.actions.RunSelection", "GraphQLExecuteEditor"},
      {"shift meta 8",             "ActivateUnitTestsToolWindow", "EditorToggleColumnMode"},
      {"shift meta H",             "ChangesView.ShelveSilently", "ReplaceInPath"},
      {"shift meta R",             "WebInspector.Browser.Refresh", "Refactorings.QuickListPopupAction"},
      {"meta alt W",               "ActivateWebToolWindow", "Vcs.UpdateProject"},
      {"shift meta S",             "SaveAll", "org.intellij.plugins.markdown.ui.actions.styling.ToggleStrikethroughAction"},
      {"shift ctrl LEFT",          "Diff.PrevChange", "EditorLeftWithSelection"},
      {"ctrl H",                   "Replace", "Vcs.ShowMessageHistory"},
      {"meta K",                   "SECOND_STROKE_SHORTCUT", "Terminal.ClearBuffer"},
      {"meta R",                   "SECOND_STROKE_SHORTCUT", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"meta E",                   "SECOND_STROKE_SHORTCUT", "SwitcherIterateItems", "SwitcherRecentEditedChangedToggleCheckBox"},
      {"meta T",                   "SearchEverywhere", "Terminal.NewTab"},
      {"alt SLASH",                "CallInlineCompletionAction", "HippieCompletion"},
    }),
    Map.entry("Default for XWin", new String[][]{
      {"ctrl SLASH",               "CommentByLineComment", "FileChooser.GoToRoot", "Graph.ActualSize"},
      {"shift ctrl C",             "CopyPaths", "DatabaseView.CopyDdlAction", "Terminal.CopySelectedText",
                                   "org.intellij.plugins.markdown.ui.actions.styling.ToggleCodeSpanAction"},
      {"shift ctrl V",             "PasteMultiple", "Terminal.Paste", "JupyterNotebookPasteCellAboveCommandModeAction"},
      {"shift ctrl alt button1",   "EditorAddRectangularSelectionOnMouseDrag", "QuickEvaluateExpression"},
      {"shift ctrl alt B",         "DatabaseView.OpenDdlInConsole", "SurroundWith"},
    }),
    Map.entry("Default for GNOME", new String[][]{
      {"shift alt 7",              "IDEtalk.SearchUserHistory", "FindUsages"},
      {"shift alt LEFT",           "PreviousEditorTab", "Diff.PrevChange", "Back"},
      {"shift alt RIGHT",          "NextEditorTab", "Diff.NextChange", "Forward"},
    }),
    Map.entry("Default for KDE", new String[][]{
      {"control 1",                "FileChooser.GotoHome", "ShowErrorDescription", "DuplicatesForm.SendToLeft"},
      {"control 2",                "FileChooser.GotoProject", "Stop", "DuplicatesForm.SendToRight"},
      {"control 3",                "FindWordAtCaret", "FileChooser.GotoModule"},
      {"control 5",                "Refresh", "Rerun"},
      {"shift alt 7",              "IDEtalk.SearchUserHistory", "FindUsages"},
      {"shift alt L",              "ReformatCode", "context.load"},
    }),
    Map.entry("Eclipse", new String[][]{
      {"F2",                       "Console.TableResult.EditValue", "QuickJavaDoc", "XDebugger.SetValue",
                                   "Table-startEditing", "Tree-startEditing", "Console.TableResult.GotoReferencedResult"},
      {"F5",                       "Graph.RouteEdges", "StepInto", "WebInspector.Browser.Refresh"},
      {"F12",                      "EditSource", "WebInspector.Browser.Selection.Toggle"},
      {"alt DOWN",                 "MoveStatementDown", "ShowContent", "ShowSearchHistory", "JupyterNotebookMoveCellDownCommandModeAction", "NotebookMoveCellDownAction"},
      {"alt HOME",                 "ViewNavigationBar", "ShowNavBar"},
      {"alt UP",                   "MoveStatementUp", "JupyterNotebookMoveCellUpCommandModeAction", "NotebookMoveCellUpAction"},
      {"control B",                "CompileDirty", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"control D",                "EditorDeleteLine", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "Terminal.CloseSession",
                                   "FileChooser.GotoDesktop", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"control F10",              "ShowPopupMenu", "UpdateRunningApplication"},
      {"control I",                "AutoIndentLines", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"control N",                "ShowPopupMenu", "FileChooser.NewFolder"},
      {"control P",                "FileChooser.TogglePathBar", "Print"},
      {"control R",                "RunToCursor", "Terminal.SearchInCommandHistory", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"control U",                "EvaluateExpression", "CommanderSwapPanels", "org.intellij.plugins.markdown.ui.actions.styling.InsertImageAction"},
      {"control W",                "CloseActiveTab", "Terminal.DeletePreviousWord"},
      {"control alt DOWN",         "Console.TableResult.NextPage", "EditorDuplicateLines"},
      {"control alt E",            "Console.History.Browse", "ExecuteInPyConsoleAction", "PerforceDirect.Edit", "ToggleFindInSelection"},
      {"control alt RIGHT",        "AIAssistant.Editor.AcceptOneLineCompletion", "PreviousTab"},
      {"ctrl 1",                   "DuplicatesForm.SendToLeft", "FileChooser.GotoHome", "ShowIntentionActions"},
      {"ctrl L",                   "GotoLine", "Terminal.ClearBuffer"},
      {"shift alt D",              "hg4idea.QFold", "Debug"},
      {"shift alt G",              "RerunTests", "hg4idea.QGotoFromPatches"},
      {"shift alt L",              "IntroduceVariable", "context.load"},
      {"shift alt P",              "hg4idea.QPushAction", "ImplementMethods"},
      {"shift alt R",              "RenameElement", "Git.Reword.Commit", "Git.Rename.Local.Branch", "ShelvedChanges.Rename", "ChangesView.Rename"},
      {"shift alt S",              "ShowPopupMenu", "context.save"},
      {"shift alt T",              "ShowPopupMenu", "tasks.switch"},
      {"shift control E",          "RecentLocations", "EditSource"},
      {"shift control F6",         "ChangeTypeSignature", "PreviousTab"},
      {"shift control I",          "QuickImplementations", "XDebugger.Inspect"},
      {"shift control K",          "Vcs.Push", "FindPrevious"},
      {"shift control T",          "GotoClass", "Terminal.NewTab"},
      {"shift control X",          "EditorToggleCase", "com.jetbrains.php.framework.FrameworkRunConsoleAction"},
      {"shift ctrl alt LEFT",      "NextEditorTab", "Diff.NextChange"},
      {"shift ctrl alt RIGHT",     "PreviousEditorTab", "Diff.PrevChange"},
      {"shift ctrl DIVIDE",        "CollapseAll", "CollapseAllRegions"},
    }),
    Map.entry("NetBeans 6.5", new String[][]{
      {"F4",                       "RunToCursor", "EditSource"},
      {"F5",                       "Debugger.ResumeThread", "Resume", "Graph.RouteEdges", "WebInspector.Browser.Refresh"},
      {"alt UP",                   "GotoPrevElementUnderCaretUsage", "JupyterNotebookMoveCellUpCommandModeAction", "NotebookMoveCellUpAction"},
      {"alt DOWN",                 "GotoNextElementUnderCaretUsage", "ShowContent", "ShowSearchHistory", "JupyterNotebookMoveCellDownCommandModeAction", "NotebookMoveCellDownAction"},
      {"control 1",                "ActivateProjectToolWindow", "DuplicatesForm.SendToLeft"},
      {"control 2",                "ActivateProjectToolWindow", "FileChooser.GotoProject", "DuplicatesForm.SendToRight"},
      {"control 3",                "ActivateProjectToolWindow", "FileChooser.GotoModule"},
      {"control BACK_SLASH",       "CodeCompletion", "FileChooser.GoToRoot"},
      {"control BACK_SPACE",       "EditorDeleteToWordStart", "ToggleDockMode"},
      {"control DIVIDE",           "CollapseRegionRecursively", "Graph.ActualSize"},
      {"control E",                "EditorDeleteLine", "Terminal.MoveCaretToLineEnd"},
      {"control I",                "GotoAction", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"control M",                "Vcs.ShowMessageHistory", "Move"},
      {"control N",                "NewElement", "FileChooser.NewFolder"},
      {"control PERIOD",           "GotoNextError", "EditorChooseLookupItemDot"},
      {"control R",                "RenameElement", "org.jetbrains.plugins.ruby.rails.console.ReloadSources", "Git.Reword.Commit",
                                   "Git.Rename.Local.Branch", "ShelvedChanges.Rename", "ChangesView.Rename", "Terminal.SearchInCommandHistory"},
      {"control U",                SECOND_STROKE, "CommanderSwapPanels", "org.intellij.plugins.markdown.ui.actions.styling.InsertImageAction"},
      {"control W",                "CloseContent", "Terminal.DeletePreviousWord"},
      {"control alt DOWN",         "MethodDown", "NextOccurence", "Console.TableResult.NextPage"},
      {"control alt E",            "Console.History.Browse", "ExecuteInPyConsoleAction", "PerforceDirect.Edit", "ToggleFindInSelection"},
      {"shift alt U",              "ActivateFindToolWindow", "ToggleCamelSnakeCase"},
      {"control alt UP",           "MethodUp", "PreviousOccurence", "Console.TableResult.PreviousPage"},
      {"control alt shift P",      "Print", "ReformatWithPrettierAction"},
      {"ctrl alt PAGE_DOWN",       "Diff.NextChange", "NextEditorTab"},
      {"ctrl alt PAGE_UP",         "Diff.PrevChange", "PreviousEditorTab"},
      {"shift F4",                 "RecentFiles", "SwitcherIterateItems", "SwitcherRecentEditedChangedToggleCheckBox", "XDebugger.JumpToTypeSource",
                                   "Vcs.ShowMessageHistory", "EditSourceInNewWindow"},
      {"shift F5",                 "Graph.ApplyCurrentLayout", "Stop"},
      {"shift alt D",              "ToggleFloatingMode", "hg4idea.QFold"},
      {"shift alt F9",             "ChooseDebugConfiguration", "ValidateXml", "ValidateJsp"},
      {"shift control F7",         "HighlightUsagesInFile", "XDebugger.NewWatch"},
      {"shift control H",          "ChangesView.ShelveSilently", "ReplaceInPath"},
      {"shift control K",          "HippieCompletion", "Vcs.Push"},
      {"shift control M",          "RInsertPipeAction", "ShowBookmarks"},
      {"shift ctrl BACK_SLASH",    "GotoUrlAction", "SmartTypeCompletion"},
      {"shift ctrl C",             "CommentByLineComment", "DatabaseView.CopyDdlAction", "org.intellij.plugins.markdown.ui.actions.styling.ToggleCodeSpanAction"},
      {"shift ctrl S",             "SaveAll", "org.intellij.plugins.markdown.ui.actions.styling.ToggleStrikethroughAction"},
    }),
    Map.entry("Eclipse (Mac OS X)", new String[][]{
      {"F2",                       "Console.TableResult.EditValue", "QuickJavaDoc", "XDebugger.SetValue", "Git.Reword.Commit", "Git.Rename.Local.Branch",
                                   "ShelvedChanges.Rename", "ChangesView.Rename", "Table-startEditing", "Tree-startEditing", "Console.TableResult.GotoReferencedResult"},
      {"F3",                       "EditSource", "GotoDeclaration"},
      {"F5",                       "StepInto", "Graph.RouteEdges", "WebInspector.Browser.Refresh"},
      {"alt DOWN",                 "MethodOverloadSwitchDown", "MoveStatementDown", "ShowSearchHistory", "JupyterNotebookMoveCellDownCommandModeAction", "NotebookMoveCellDownAction"},
      {"alt UP",                   "MoveStatementUp", "MethodOverloadSwitchUp", "JupyterNotebookMoveCellUpCommandModeAction", "NotebookMoveCellUpAction"},
      {"control PERIOD",           "EditorChooseLookupItemDot", "HippieCompletion"},
      {"control shift alt Z",      "Vcs.RollbackChangedLines", "ChangesView.Revert"},
      {"meta 1",                   "FileChooser.GotoHome", "ShowIntentionActions", "DuplicatesForm.SendToLeft"},
      {"meta 3",                   "FileChooser.GotoModule", "GotoAction"},
      {"meta B",                   "CompileDirty", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"meta BACK_SPACE",          "EditorDeleteToWordStart", "$Delete"},
      {"meta D",                   "EditorDeleteLine", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "FileChooser.GotoDesktop"},
      {"meta I",                   "DatabaseView.PropertiesAction", "AutoIndentLines", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"meta K",                   "FindNext", "Terminal.ClearBuffer"},
      {"meta P",                   "FileChooser.TogglePathBar", "Print"},
      {"meta R",                   "RunToCursor", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"meta U",                   "CommanderSwapPanels", "EvaluateExpression", "org.intellij.plugins.markdown.ui.actions.styling.InsertImageAction"},
      {"meta W",                   "CloseContent", "CloseActiveTab"},
      {"meta alt B",               "ShowNavBar", "org.jetbrains.r.rendering.chunk.RunChunksAboveAction"},
      {"meta alt C",               "ChangeSignature", "org.jetbrains.r.rendering.chunk.RunChunkAction"},
      {"meta alt DOWN",            "Console.TableResult.NextPage", "EditorDuplicateLines"},
      {"meta alt I",               "Inline", "RMarkdownNewChunk"},
      {"meta alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "NextTab"},
      {"shift ctrl DOWN",          "EditorUnSelectWord", "ShowContent"},
      {"shift meta K",             "Vcs.Push", "FindPrevious"},
      {"shift meta R",             "GotoFile", "WebInspector.Browser.Refresh"},
      {"shift meta U",             "FindUsagesInFile", "ShelveChanges.UnshelveWithDialog", "Markdown.Styling.CreateLink"},
      {"shift meta X",             "EditorToggleCase", "com.jetbrains.php.framework.FrameworkRunConsoleAction"},
      {"shift meta DIVIDE",        "CollapseAll", "CollapseAllRegions"},
    }),
    Map.entry("Sublime Text", new String[][]{
      {"F2",                       "ChangesView.Rename", "Console.TableResult.EditValue", "Git.Reword.Commit", "Git.Rename.Local.Branch",
                                   "GotoNextBookmark", "GuiDesigner.EditComponent", "GuiDesigner.EditGroup", "ShelvedChanges.Rename",
                                   "XDebugger.SetValue", "Table-startEditing", "Tree-startEditing", "Console.TableResult.GotoReferencedResult"},
      {"F12",                      "GotoDeclaration", "WebInspector.Browser.Selection.Toggle"},
      {"alt MINUS",                "Back", "RInsertAssignmentAction"},
      {"ctrl ADD",                 "EditorIncreaseFontSize", "ExpandAll", "ExpandExpandableComponent"},
      {"ctrl B",                   "Compile", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"ctrl D",                   "CompareTwoFiles", "Diff.ShowDiff", "FileChooser.GotoDesktop", "SelectNextOccurrence", "SendEOF",
                                   "Terminal.CloseSession", "org.jetbrains.r.console.RConsoleView.REofAction"},
      {"ctrl ENTER",               "Console.Execute.Multiline", "DirDiffMenu.SynchronizeDiff.All", "EditorStartNewLine", "NotebookRunCellAction",
                                   "PyExecuteCellAction", "ViewSource", "org.jetbrains.r.actions.RunSelection", "Terminal.SmartCommandExecution.Run",
                                   "SplitChooser.Duplicate", "Docker.RemoteServers.StartComposeService", "GraphQLExecuteEditor"},
      {"ctrl EQUALS",              "EditorIncreaseFontSize", "ExpandAll", "ExpandExpandableComponent"},
      {"ctrl I",                   "IncrementalSearch", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"ctrl L",                   "EditorSelectLine", "Terminal.ClearBuffer"},
      {"ctrl M",                   "EditorMatchBrace", "Vcs.ShowMessageHistory"},
      {"ctrl MINUS",               "CollapseAll", "CollapseExpandableComponent", "EditorDecreaseFontSize"},
      {"ctrl N",                   "FileChooser.NewFolder", "NewElement"},
      {"ctrl P",                   "FileChooser.TogglePathBar", "GotoFile"},
      {"ctrl R",                   "FileStructurePopup", "Terminal.SearchInCommandHistory", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"ctrl SUBTRACT",            "CollapseAll", "CollapseExpandableComponent", "EditorDecreaseFontSize"},
      {"ctrl V",                   "EditorPasteSimple", "Terminal.Paste", "JupyterNotebookPasteCellCommandModeAction"},
      {"ctrl W",                   "CloseContent", "Terminal.DeletePreviousWord"},
      {"ctrl alt DOWN",            "Console.TableResult.NextPage", "EditorCloneCaretBelow"},
      {"ctrl alt UP",              "Console.TableResult.PreviousPage", "EditorCloneCaretAbove"},
      {"shift ENTER",              "CollapseExpandableComponent", "Console.TableResult.EditValueMaximized", "DatabaseView.PropertiesAction",
                                   "EditorSplitLine", "ExpandExpandableComponent", "NotebookRunCellSelectBelowAction", "OpenInRightSplit",
                                   "PyExecuteCellActionWithMove", "RConsoleNextLineAction"},
      {"shift INSERT",             "EditorPasteSimple", "Terminal.Paste"},
      {"shift ctrl D",             "Console.TableResult.CompareCells", "EditorDuplicate", "Uml.ShowDiff", "JavaScript.ShowComponentUsages"},
      {"shift ctrl ENTER",         "Console.Jpa.GenerateSql", "EditorStartNewLineBefore", "org.jetbrains.r.actions.RRunAction",
                                   "Terminal.SmartCommandExecution.Debug", "Console.TableResult.ShowRecordView"},
      {"shift ctrl M",             "EditorSelectWord", "RInsertPipeAction"},
      {"shift ctrl T",             "ReopenClosedTab", "ServiceView.ShowServices", "Terminal.NewTab"},
      {"shift ctrl V",             "$Paste", "JupyterNotebookPasteCellAboveCommandModeAction"},
      {"shift ctrl EQUALS",        "CompilationChartsZoomResetAction", "EditorDecreaseFontSize"},
    }),
    Map.entry("Sublime Text (Mac OS X)", new String[][]{
      {"F2",                       "ChangesView.Rename", "Console.TableResult.EditValue", "Git.Reword.Commit", "Git.Rename.Local.Branch",
                                   "GotoNextBookmark", "GuiDesigner.EditComponent", "GuiDesigner.EditGroup", "ShelvedChanges.Rename",
                                   "XDebugger.SetValue", "Table-startEditing", "Tree-startEditing", "Console.TableResult.GotoReferencedResult"},
      {"F12",                      "GotoDeclaration", "WebInspector.Browser.Selection.Toggle"},
      {"ctrl R",                   "GotoNextBookmark", "Terminal.SearchInCommandHistory"},
      {"meta ADD",                 "EditorIncreaseFontSize", "ExpandAll", "ExpandExpandableComponent"},
      {"meta B",                   "Compile", "org.intellij.plugins.markdown.ui.actions.styling.ToggleBoldAction"},
      {"meta BACK_SPACE",          "EditorDeleteToLineStart", "$Delete"},
      {"meta D",                   "CompareTwoFiles", "Diff.ShowDiff", "FileChooser.GotoDesktop", "SelectNextOccurrence", "SendEOF"},
      {"meta DOWN",                "EditorTextEnd", "Terminal.SelectPrompt"},
      {"meta ENTER",               "Console.Execute.Multiline", "DirDiffMenu.SynchronizeDiff.All", "EditorStartNewLine", "ViewSource",
                                   "org.jetbrains.r.actions.RunSelection", "Terminal.SmartCommandExecution.Run", "SplitChooser.Duplicate",
                                   "Docker.RemoteServers.StartComposeService", "GraphQLExecuteEditor"},
      {"meta EQUALS",              "EditorIncreaseFontSize", "ExpandAll", "ExpandExpandableComponent"},
      {"meta I",                   "DatabaseView.PropertiesAction", "IncrementalSearch", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"meta K",                   SECOND_STROKE, "Terminal.ClearBuffer"},
      {"meta L",                   "EditorSelectLine", "Terminal.ClearBuffer"},
      {"meta MINUS",               "CollapseAll", "CollapseExpandableComponent", "EditorDecreaseFontSize"},
      {"meta P",                   "FileChooser.TogglePathBar", "GotoFile"},
      {"meta R",                   "FileStructurePopup", "Refresh", "Rerun", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"},
      {"meta SUBTRACT",            "CollapseAll", "CollapseExpandableComponent", "EditorDecreaseFontSize"},
      {"meta T",                   "GotoFile", "Terminal.NewTab"},
      {"meta UP",                  "EditorTextStart", "FileChooser.GoToParent", "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"meta V",                   "EditorPasteSimple", "Terminal.Paste", "JupyterNotebookPasteCellCommandModeAction"},
      {"meta alt DOWN",            "Console.TableResult.NextPage", "GotoDeclaration"},
      {"meta alt G",               "DatabaseView.SqlGenerator", "FindWordAtCaret", "org.jetbrains.plugins.ruby.rails.actions.generators.GeneratorsPopupAction"},
      {"meta alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "NextTab"},
      {"shift ENTER",              "CollapseExpandableComponent", "Console.TableResult.EditValueMaximized", "EditorSplitLine",
                                   "PyExecuteCellActionWithMove", "ExpandExpandableComponent", "NotebookRunCellSelectBelowAction", "OpenInRightSplit", "RConsoleNextLineAction"},
      {"shift ctrl DOWN",          "EditorCloneCaretBelow", "ShowContent"},
      {"shift meta D",             "Console.TableResult.CompareCells", "EditorDuplicate", "Uml.ShowDiff", "JavaScript.ShowComponentUsages"},
      {"shift meta R",             "GotoSymbol", "WebInspector.Browser.Refresh"},
      {"shift meta ENTER",         "Console.Jpa.GenerateSql", "EditorStartNewLineBefore", "org.jetbrains.r.actions.RRunAction",
                                   "Terminal.SmartCommandExecution.Debug", "Console.TableResult.ShowRecordView"},
      {"shift meta T",             "ReopenClosedTab", "ServiceView.ShowServices"},
      {"shift meta V",             "$Paste", "JupyterNotebookPasteCellAboveCommandModeAction"},
    }),
    Map.entry("macOS System Shortcuts", new String[][]{
      {"ctrl C",                   "Terminal.ClearPrompt", "Vcs.QuickListPopupAction", "org.jetbrains.r.console.RConsoleView.RInterruptAction"},
      {"ctrl ENTER",               "EditorSplitLine", "NotebookRunCellAction", "PyExecuteCellAction"},
      {"ctrl O",                   "EditorSplitLine", "ExportToTextFile"},
      {"ctrl alt DOWN",            "MethodDown", "ResizeToolWindowDown"},
      {"ctrl alt UP",              "MethodUp", "ResizeToolWindowUp"},
      {"ctrl meta M",              "ChangesView.Move", "Vcs.MoveChangedLinesToChangelist"},
      {"meta CLOSE_BRACKET",       "Forward", "NextDiff"},
      {"meta DOWN",                "EditSourceNotInEditor", "EditorTextEnd", "Terminal.SelectPrompt"},
      {"meta I",                   "DatabaseView.PropertiesAction", "QuickJavaDoc", "org.intellij.plugins.markdown.ui.actions.styling.ToggleItalicAction"},
      {"meta OPEN_BRACKET",        "Back", "PreviousDiff"},
      {"meta UP",                  "EditorTextStart", "FileChooser.GoToParent", "Terminal.SelectLastBlock", "Terminal.SelectBlockAbove"},
      {"meta alt DOWN",            "Console.TableResult.NextPage", "NotebookSelectCellBelowAction", "NextOccurence"},
      {"meta alt E",               "Console.History.Browse", "GotoNextElementUnderCaretUsage", "PerforceDirect.Edit"},
      {"meta alt I",               "Move", "RMarkdownNewChunk"},
      {"meta alt UP",              "Console.TableResult.PreviousPage", "NotebookSelectCellAboveAction", "PreviousOccurence"},
      {"meta alt RIGHT",           "AIAssistant.Editor.AcceptOneLineCompletion", "NextTab"},
      {"shift alt SEMICOLON",      "ForceStepInto", SECOND_STROKE},
      {"shift meta T",             "ReopenClosedTab", "ServiceView.ShowServices"},
      {"shift meta alt BACK_SLASH","AIAssistant.Chat.AIPopupChat", "ToggleTemporaryLineBreakpoint"}
    })
  );
  // @formatter:on

  private static final Set<String> DEFAULT_UNKNOWN_ACTION_IDS = Set.of(
    "ActivateVersionControlToolWindow", "ActivateFavoritesToolWindow", "ActivateBookmarksToolWindow", "ActivateCommanderToolWindow",
    "ActivateServicesToolWindow", "ActivateMessagesToolWindow", "ActivateProjectToolWindow", "ActivateStructureToolWindow",
    "ActivateProblemsViewToolWindow", "ActivateTODOToolWindow", "ActivateWebToolWindow", "ActivatePaletteToolWindow", "ActivateTerminalToolWindow",
    "IDEtalk.SearchUserHistory", "IDEtalk.Rename", "CIDR.Lang.Cpp.GenerateDefinitions", "ActivateErrorsInSolutionToolWindow",
    "ActivateUnitTestsToolWindow", "ActivateDatabaseToolWindow", "ActivateBuildToolWindow", "ActivateNuGetToolWindow",
    "RiderBackendAction-EncapsulateField", "SwitchHeaderSource", "BuildProject", "RebuildProject", "BuildSolutionAction", "RebuildSolutionAction",
    "ActivateInspectionResultsToolWindow", "", "ValidateXml"
  );

  private static final Set<String> DEFAULT_BOUND_ACTIONS = Set.of(
    "EditorDelete",
    "List-selectLastRowExtendSelection",
    "List-selectLastRow",
    "List-selectFirstRowExtendSelection",
    "List-selectFirstRow",
    "Tree-selectLastExtendSelection",
    "Tree-selectLast",
    "Tree-selectFirstExtendSelection",
    "Tree-selectFirst",
    "Vcs.CombinedDiff.CaretToPrevBlock",
    "Vcs.CombinedDiff.CaretToNextBlock"
  );

  private static final Set<String> DEFAULT_CONFLICT_SAFE_GROUPS = Set.of(
    "Log.KeymapGroup",
    "UsageGroupingActionGroup",
    "UsageFilteringActionGroup",
    "SearchEverywhereActions",
    "Images.ThumbnailViewActions",
    "Images.ImageViewActions",
    "ArrangementRulesGroup",
    "ServiceViewTreeToolbar",
    "TodoViewGroupByGroup",
    "ChangesView.GroupBy"
  );

  @Override
  protected Map<String, Map<String, List<String>>> getKnownDuplicates() {
    return parseDuplicates(DEFAULT_DUPLICATES);
  }

  @Override
  protected Set<String> getUnknownActions() {
    return DEFAULT_UNKNOWN_ACTION_IDS;
  }

  @Override
  protected @NotNull Set<String> getBoundActions() {
    return DEFAULT_BOUND_ACTIONS;
  }

  @Override
  protected Set<String> getConflictSafeGroups() {
    return DEFAULT_CONFLICT_SAFE_GROUPS;
  }

  @Override
  protected String getGroupForUnknownAction(@NotNull String actionId) {
    return actionId.equals("ChangesView.GroupBy.Module") ? "ChangesView.GroupBy" : null;
  }
}
